package cn.webrx.config;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

import javax.sql.DataSource;

@Configuration
public class DruidConfig {
    @Bean(name = "ds",initMethod = "init",destroyMethod = "close")
    public DruidDataSource dateSource(){
        var ds = new DruidDataSource();
        ds.setUsername("root");
        ds.setUrl("jdbc:mysql:/wxdb");
        return ds;
    }
}
